/* Mobile-specific styles and optimizations */

/* Viewport meta tag optimization */
@viewport {
  width: device-width;
  initial-scale: 1;
  maximum-scale: 5;
  user-scalable: yes;
}

/* Touch-friendly tap targets */
@media (max-width: 768px) {
  /* Increase touch targets to minimum 44x44px */
  button, a, input, select, textarea {
    min-height: 44px;
    min-width: 44px;
  }

  /* Better spacing for mobile */
  .ant-btn {
    padding: 8px 16px;
    min-height: 44px;
  }

  .ant-input {
    padding: 8px 12px;
    min-height: 44px;
  }

  /* Optimize table for mobile */
  .ant-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Stack form items vertically on mobile */
  .ant-form-item {
    margin-bottom: 16px;
  }

  .ant-form-item-label {
    text-align: left;
  }

  /* Optimize modal for mobile */
  .ant-modal {
    max-width: calc(100vw - 32px);
    margin: 16px auto;
  }

  /* Better dropdown positioning */
  .ant-dropdown {
    max-width: calc(100vw - 32px);
  }

  /* Optimize cards for mobile */
  .ant-card {
    border-radius: 8px;
  }

  .ant-card-body {
    padding: 16px;
  }

  /* Hide desktop-only elements */
  .desktop-only {
    display: none !important;
  }

  /* Adjust font sizes for readability */
  h1 { font-size: 24px; }
  h2 { font-size: 20px; }
  h3 { font-size: 18px; }
  h4 { font-size: 16px; }
  
  /* Better spacing for content */
  p {
    line-height: 1.6;
    margin-bottom: 12px;
  }

  /* Optimize sidebar drawer */
  .ant-drawer-body {
    padding: 0;
  }

  /* Better list spacing */
  .ant-list-item {
    padding: 12px 16px;
  }

  /* Optimize tabs for mobile */
  .ant-tabs-nav {
    margin: 0;
  }

  .ant-tabs-tab {
    padding: 8px 12px;
  }

  /* Better spacing for messages */
  .ant-message {
    top: 70px !important;
  }

  /* Optimize notification position */
  .ant-notification {
    top: 70px !important;
    right: 8px !important;
    left: 8px !important;
    width: auto !important;
  }
}

/* Tablet-specific adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
  .ant-card {
    margin-bottom: 16px;
  }

  .ant-form-item-label {
    flex: 0 0 120px;
  }
}

/* Prevent horizontal scrolling */
html, body {
  overflow-x: hidden;
  width: 100%;
}

/* Smooth scrolling for better UX */
html {
  scroll-behavior: smooth;
}

/* Better focus states for accessibility */
*:focus-visible {
  outline: 2px solid #1890ff;
  outline-offset: 2px;
}

/* Optimize images for mobile */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Better loading states */
.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Optimize for dark mode */
@media (prefers-color-scheme: dark) {
  .ant-layout {
    background: #141414;
  }
  
  .ant-card {
    background: #1f1f1f;
    border-color: #303030;
  }
}

/* Performance optimizations */
.hardware-accelerated {
  transform: translateZ(0);
  will-change: transform;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}